﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xrm.Sdk.Client;

namespace CRM2011.FetchXMLExecuteTool
{
    public class CRMAuthenticationProvider
    {
        public static ServerConnection.Configuration GetServerConnection(string serverAddress,
            bool ssl,
            string discoveryUri,
            bool isOnline,
            AuthenticationProviderType authenticationType,
             String userName,
            String password,
            String domain,
            string organizationUri

            )
        {
            ServerConnection connection = new ServerConnection();
            ServerConnection.Configuration config = connection.GetServerConfiguration(serverAddress,
                ssl,
                new Uri(discoveryUri),
                isOnline,
                authenticationType,
                userName,
                password,
                domain, new Uri(organizationUri));
            return config;
        }
    }
}
